import { createApp } from 'vue'
import index from './index.vue'

export default (url: string) => {
  const root = document.createElement('div')
  document.body.appendChild(root)

  const app = createApp(index, {
    url,
    visible: true,
    remove() {
      app.unmount()
      document.body.removeChild(root)
    }
  })
  return app.mount(root)
}
